#include <iostream>
#include <string>
using namespace std;

int simple(int n) {
int d = 0;
for (int i=1; i<=n;i++)
    if (n % i == 0) d++;
    if (d==2) return n;
    return 0;
}

int main(){

    string text;
    getline(cin, text);
//
    int pr=0;
    for (int i=0; i < text.size(); i++)
        if (text[i] == ' ')
            pr++;

    string slova[pr+1];
    string word;


    int k = 0;
    for (int i=0; i < text.size(); i++){
        if (text[i] == ' '){
            slova[k] = word;
            word = "";
            k++;
        }
        else word += text[i];
    }
      slova[k] = word;

    int s = 0, d = 0, e=0;
    if (slova[0] == "zero") e =0;
    if (slova[0] == "one") e =1;
    if (slova[0] == "two") e =2;
    if (slova[0] == "three") e =3;
    if (slova[0] == "four") e =4;
    if (slova[0] == "five") e =5;
    if (slova[0] == "six")e =6;
    if (slova[0] == "seven") e =7;
    if (slova[0] == "eight") e =8;
    if (slova[0] == "nine") e =9;


    if (slova[1] == "zero") e =0;
    if (slova[1] == "one") e =1;
    if (slova[1] == "two") e =2;
    if (slova[1] == "three") e =3;
    if (slova[1] == "four") e =4;
    if (slova[1] == "five") e =5;
    if (slova[1] == "six")e =6;
    if (slova[1] == "seven") e =7;
    if (slova[1] == "eight") e =8;
    if (slova[1] == "nine") e =9;

    if (slova[2] == "zero") e =0;
    if (slova[2] == "one") e =1;
    if (slova[2] == "two") e =2;
    if (slova[2] == "three") e =3;
    if (slova[2] == "four") e =4;
    if (slova[2] == "five") e =5;
    if (slova[2] == "six")e =6;
    if (slova[2] == "seven") e =7;
    if (slova[2] == "eight") e =8;
    if (slova[2] == "nine") e =9;
    int n = s*100 + d*10 + e;

    cout <<simple(n);
}
